﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using QLNS.api;
namespace QLNS.Controllers
{
    public class KNNGController : Controller
    {
        //
        // GET: /KNNG/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult GetAll()
        {
            var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() };
            var objs = new KNangNNguAPIController().Get();
            var jsonResult = new ContentResult
            {
                Content = JsonConvert.SerializeObject(objs, settings),
                ContentType = "application/json"
            };
            return jsonResult;
        }
    }
}
